#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : bypos.py
# Date    : 2021-03-16
# Author  : Tom.Lee


from selenium import webdriver
from coral import Page, Element, Browser

Browser.show = True


class BaiduIndexPage(Page):
    search_input = Element(css="#kw", describe="搜索框")
    search_button = Element(css="#su", describe="搜索按钮")


if __name__ == '__main__':
    driver = webdriver.Chrome()
    mypage = BaiduIndexPage(driver)
    mypage.get("https://www.baidu.com/")
    mypage.search_input.input("中国")
    mypage.search_button.click()
    mypage.driver.quit()
